import React, { useEffect } from "react";
import { connect } from "react-redux";
import "./college.less";
import { Button } from "antd";
import action from "../../../store/Actions/index";
import {
  PartitionOutlined
} from "@ant-design/icons";
interface Props {
  datalist: Array<any>;
  getscblist: any;
  administratorReducer?: any;
  getcollegelist: any;
  collegelist?: any;
}
const College = (props: Props) => {
  const { collegelist } = props.administratorReducer;
  useEffect(() => {
    const { getcollegelist } = props;
    getcollegelist();
  }, []);
  console.log(collegelist,'获取到数据');
  
  return (
    <div className="college">
      <div className="h3">
        <h3>学院管理</h3>
        <Button type="primary" icon={<PartitionOutlined />}>创建学院</Button>
      </div>
      <div className="Collegelist">
        {
        collegelist && collegelist.map((item, index) => {
            return (
              <div key={index} className="box">
                <div className="collegetitle">{item.college}</div>
                <div className="collegecontext">
                  <p>{item.title1}</p>
                  <p>{item.title2}</p>
                  <p>{item.title3}</p>
                  <p>{item.title4}</p>
                </div>
                <div className="collegebtn">
                  <Button type="primary">详情</Button>
                </div>
              </div>
            );
          })}
      </div>
    </div>
  );
};
export default connect((state) => state, action.administratorActions)(College);
